<?php

function run_page_app($action = 'list') {
	$action = trim($action);
	switch ($action) {
	case 'create':
		require APP_PATH . '/' . APP_ADMIN_NAME . '/page/create.php';
		break;
	case 'delete':
		require APP_PATH . '/' . APP_ADMIN_NAME . '/page/delete.php';
		break;
	case 'preview':
		require APP_PATH . '/' . APP_ADMIN_NAME . '/page/preview.php';
		break;
	case 'list':
	default:
		$action = 'list';
		require APP_PATH . '/' . APP_ADMIN_NAME . '/page/list.php';
		break;
	}

	if (function_exists('page_' . $action . '_action')) {
		call_user_func('page_' . $action . '_action');
	}
}